package com.cloud.api.policy;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 售后政策
 * </p>
 *
 * @author dhaigang
 * @since 2023-07-19
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("t_sale_policy")
@Schema(name = "SalePolicy", description = "售后政策")
public class SalePolicy implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键")
    @TableId("policy_id")
    private String policyId;

    @Schema(description = "政策标题")
    @TableField("policy_name")
    @NotEmpty(message = "请输入标题")
    @Size(max = 10, message = "限制10位字符串")
    private String policyName;

    @Schema(description = "说明")
    @TableField("note")
    @NotEmpty(message = "请输入说明")
    @Size(max = 50, message = "限制50位字符串")
    private String note;

    @Schema(description = "创建人",hidden = true)
    @TableField(value = "create_user", fill = FieldFill.INSERT)
    private String createUser;

    @Schema(description = "更新人",hidden = true)
    @TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    @Schema(description = "更新时间",hidden = true)
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "创建时间",hidden = true)
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "删除标记")
    @TableField("deleted")
    private int deleted;
}
